#ifndef _LAB4_FS_H
#define _LAB4_FS_H

#define LAB4FS_ROOT_INO 2
#define LAB4FS_MAGIC 0xABCD
#define LAB4FS_BLOCK_SIZE 1024
#define LAB4FS_NBLOCKS 12  // same as ext2's num of direct blocks

#include <linux/types.h>

struct lab4fs_super_block {
	//__u32 s_inodes_count;
	__u32 s_blocks_count;
	__u16 s_magic;
};

struct lab4fs_sb_info {
	struct buffer_head * s_sbh;  /* Buffer containing the super block */
	struct lab4fs_super_block * s_l4s;
};

#ifdef __KERNEL__
static inline struct lab4fs_sb_info * LAB4FS_SB(struct super_block *sb)
{
	return sb->s_fs_info;
}
#else
/* Assume that user mode programs are passing in a lab4fs superblock, not
 * a kernel struct super_block.
 */
#define LAB4FS_SB(sb)	(sb)
#endif

#endif	/* _LAB4_FS_H */
